package com.hzit.bj1804.dianweb.service;

import com.github.pagehelper.PageInfo;
import com.hzit.bj1804.dian.entity.Memberbase;
import com.hzit.bj1804.dian.vo.MemberPage;
import feign.Param;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Date;
import java.util.List;

@FeignClient(value = "USER-CLIENT",fallback = MemberbaseFallBackImpl.class)
public interface MemberService {
    /**
     * 查询所有会员
     */
    @RequestMapping("mseleteAll")
    List<Memberbase> seleteAll();
    /**
     * 根据会员名称查询会员信息
     */
    @RequestMapping("mseleteByNmae")
    Memberbase seleteByNmae(@RequestParam("mname")String mname);
    /**
     * 根据注册时间查询会员信息
     */
    @RequestMapping("mseleteByTime")
    List<Memberbase> seleteByTime(@RequestParam("starttime") Date starttime, @RequestParam("endtime") Date endtime, @RequestParam("mname") String mname);
    /**
     * 添加会员信息
     */
    @RequestMapping("minsert")
    int insert(@RequestBody Memberbase memberbase);
    /**
     * 根据分页查询所有会员
     */
    @RequestMapping("mseleteAllPage")
    PageInfo<Memberbase> seleteAllPage(@RequestParam("limit") int limit,@RequestParam("page") int page);
    /**
     * 根据注册时间查询会员信息并分页
     */
    @RequestMapping("mseleteByTimePage")
    PageInfo<Memberbase> seleteByTimePage(@RequestParam("limit") int limit,@RequestParam("page") int page,@RequestParam("starttime") Date starttime, @RequestParam("endtime") Date endtime, @RequestParam("mname") String mname);
    /**
     * 修改状态
     */
    @RequestMapping("mupdate")
    int update(@RequestParam("mid") int mid,@RequestParam("mstatus")String mstatus);
    /**
     * 修改密码
     */
    @RequestMapping("updatePassword")
    int updatePassword(@RequestParam("mname") String mname,@RequestParam("newmpassword") String newmpassword);
    /**
     * 用户登录
     */
    @RequestMapping("mselect")
    Memberbase select(@RequestParam("mname") String mname,@RequestParam("mpassword") String mpassword);
    /**
     * 通过MID查询会员信息
     */
    @RequestMapping("mselectByMid")
    Memberbase selectByMid(@RequestParam("mid") int mid);
}
